import axios from '../axios'
export default class patrol {
  ////////////////////////////////// 巡查类别///////////////////////////////////
  static async myPatrolCategoryInsert(params) { //新增类别
    let res = await axios.post(`/business/patrolCategory/insert`, params)
    return res.data
  }
  static async myPatrolCategoryUpdate(params) { //修改类别
    let res = await axios.post(`/business/patrolCategory/update`, params)
    return res.data
  }
  static async myPatrolCategoryDetail(id) { //类别详情
    let res = await axios.get(`/business/patrolCategory/getCategoryDetail?id=${id}`)
    return res.data
  }
  static async myGetCategoryList(params) { //类别列表
    let res = await axios.post(`/business/patrolCategory/getCategoryList`, params)
    return res.data
  }
  static async myPatrolCategoryBatchDelete(params) { //类别批量删除
    let res = await axios.post(`/business/patrolCategory/batchDelete`, params)
    return res.data
  }
  static async myGetSelectIdsArray(params) { //获取选择的id数组
    let res = await axios.post(`/business/patrolCategory/getSelectIdsArray`, params)
    return res.data
  }
  static async myPatrolQRCodeInsert(params) { //生成巡查码
    let res = await axios.post(`/business/patrolQRCode/insert`, params)
    return res.data
  }
  static async myGetCodeListByCategory(id) { //巡查类别下的巡查码列表
    let res = await axios.get(`/business/patrolCategory/getCodeListByCategory?categoryId=${id}`)
    return res.data
  }

  //////////////////////巡查二维码////////////////////////
  static async myPatrolGetCommunityList(name) { //所属小区列表
    let res = await axios.get('/business/patrolQRCode/getCommunityList?name=' + name)
    return res.data
  }
  static async myGetStaffList(params) { //扫码权限人列表
    let res = await axios.post(`/business/patrolQRCode/getStaffList`, params)
    return res.data
  }
  static async myGetCodeDetail(id) { //巡查码详情
    let res = await axios.get(`/business/patrolQRCode/getCodeDetail?id=${id}`)
    return res.data
  }
  static async myGetCodeList(params) { //巡查码列表
    let res = await axios.post(`/business/patrolQRCode/getCodeList`, params)
    return res.data
  }
  static async myPatrolQRCodeBatchDeleteCode(params) { //批量删除
    let res = await axios.post(`/business/patrolQRCode/batchDeleteCode`, params)
    return res.data
  }
  static async myPatrolQRCodeGetSelectIdsArray(params) { //获取选择的id数组，用于全部选中
    let res = await axios.post(`/business/patrolQRCode/getSelectIdsArray`, params)
    return res.data
  }

  /////////////////////巡查记录/////////////////////
  static async myQrCodeScanHistoryList(params) { //巡查扫码记录列表条件查询
    let res = await axios.post(`/business/qrCodeScanHistory/list`, params)
    return res.data
  }
  static async myQrCodeScanHistoryDelete(id) { //删除记录
    let res = await axios.get(`/business/qrCodeScanHistory/delete?id=${id}`)
    return res.data
  }
  static async myQrCodeScanHistoryDetail(id) { //巡查扫码记录详情
    let res = await axios.get(`/business/qrCodeScanHistory/detail?id=${id}`)
    return res.data
  }
  static async myGetResidentialQuartersList() { //巡查扫码记录详情
    let res = await axios.get(`/business/qrCodeScanHistory/getResidentialQuartersList`)
    return res.data
  }
}
